<template>
  <div>
    <el-select
      v-model="formData.provinceId"
      placeholder="请选择省份"
      clearable
      @change="provinceChange"
    >
      <el-option v-for="item in provinces" :key="item.id" :label="item.areaName" :value="item.id" />
    </el-select>
    <el-select v-model="formData.cityId" placeholder="请选择城市" clearable @change="cityChange">
      <el-option
        v-for="item in citys"
        :key="item.id"
        :label="item.areaName"
        :value="item.id"
      ></el-option>
    </el-select>
    <el-select v-model="formData.areaId" placeholder="请选择区县" clearable @change="countyChange">
      <el-option
        v-for="item in countys"
        :key="item.id"
        :label="item.areaName"
        :value="item.id"
      ></el-option>
    </el-select>
  </div>
</template>

<script>
import cityMixins from './city-mixins'
export default {
  name: 'AreaSelect',
  props: {
    value: Object
  },
  mixins: [cityMixins],
  data() {
    return {}
  },
  computed: {
    formData: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('input', val)
      }
    }
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {}
}
</script>

<style lang="scss" scoped>
.el-select {
  margin-right: 10px;
}
</style>
